﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Efficiency.Controls;
using Konst3d.Efficiency.Suite;

// https://picasaweb.google.com/kniganapolke/Bangkok#
// https://picasaweb.google.com/igorgornostali

namespace ControlsTestApp
{
	public enum TestEnum
	{
		Value1,
		Value2
	}

	public class Day : IStatisticDay
	{
		#region IStatisticDay Members

		public DateTime Date
		{
			get;
			set;
		}

		public bool Active
		{
			get;
			set;
		}

		public float Value
		{
			get;
			set;
		}

		public string Commentary
		{
			get;
			set;
		}

		#endregion
	}

    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
		public class Test
		{
			public string Title
			{
				get;
				set;
			}

			public DateTime Date
			{
				get;
				set;
			}
		}

        public MainWindow()
        {
			InitializeComponent();

			uiTimeLine.BindingPropertyName = "Date";
			uiTimeLine.Items = new Test[] { new Test { Title = "1", Date = DateTime.Now.AddDays(1) },
				new Test { Title = "2", Date = DateTime.Now.AddDays(1) },
				new Test { Title = "3", Date = DateTime.Now.AddDays(3) } };

			/*
			TempMonitor[] monitors = new TempMonitor[10];

			for (int i = 0; i < monitors.Length; ++i)
			{
				monitors[i] = new TempMonitor()
				{
					Title = "Title #" + i,
					Description = "Descriptio #" + i,
					Active = true,
					Efficiency = i,
					Created = DateTime.Now.AddDays(-i)
				};
			}


			monitors[2].Title = "Smook dropping";
			monitors[2].Active = false;

			uiMonitorList.Monitors = monitors;
			*/

			Day[] days = new Day[31];

			for (int i = 0; i < days.Length; ++i)
			{
				days[i] = new Day()
				{
					Active = true,
					Commentary = "Commentary #" + i,
					Date = DateTime.Now.AddDays(-i),
					Value = 40 + i * 2
				};
			}

			uiHistogram.Items = days;
        }

		// test button click
		private void Button_Click(object sender, RoutedEventArgs e)
		{
			uiTestGrid.RowDefinitions.Clear();
			uiTestGrid.ColumnDefinitions.Clear();

			uiTestGrid.RowDefinitions.Add(new RowDefinition()); // year
			uiTestGrid.RowDefinitions.Add(new RowDefinition()); // month
			uiTestGrid.RowDefinitions.Add(new RowDefinition()); // day

			uiTestGrid.ColumnDefinitions.Add(new ColumnDefinition());
			uiTestGrid.ColumnDefinitions.Add(new ColumnDefinition());
			uiTestGrid.ColumnDefinitions.Add(new ColumnDefinition());

			var label = new Label() { Content = "LABEL2" };

			Grid.SetRow(label, 1);
			Grid.SetColumn(label, 1);

			uiTestGrid.Children.Add(label);
		}

		// resolution changed
		private void uiResolutionComboBox2_SelectionChanged(object sender, SelectionChangedEventArgs e)
		{
			//
		}

		// orientation changed
		private void uiOrientationComboBox2_SelectionChanged(object sender, SelectionChangedEventArgs e)
		{
			//
		}
    }
}
